/////////////////////////////////////////////////////////////////////////
//
// Amuse Engine SDK - core/containment
// Copyright (c) 2014.  All Rights Reserved
//
// File:		AEBoundingSphere.inl
// Author:		Gianluca Belardelli
// Date:		01/10/2013
//
/////////////////////////////////////////////////////////////////////////
#ifndef _AEBOUNDINGSPHERE_INL_
#define _AEBOUNDINGSPHERE_INL_
/*
static const AEBoundingSphere &AEBoundingSphere::CreateEmptyBoundingSphere( void )
{
}
*/
AE_FORCEINLINE AEBoundingSphere::AEBoundingSphere( void ) { }
AE_FORCEINLINE AEBoundingSphere::AEBoundingSphere( const AEVector4f &vcCenter, const float fRadius )
{
	/*m_vcCenter.fX = vcCenter.fX;
	m_vcCenter.fY = vcCenter.fY;
	m_vcCenter.fZ = vcCenter.fZ;
	m_vcCenter.fW = fRadius;*/

	m_vcCenter = vcCenter;
	m_vcCenter.SetW( fRadius );
}

AE_FORCEINLINE AEBoundingSphere::AEBoundingSphere( float fCenterX, float fCenterY, float fCenterZ, float fRadius )
{
	m_vcCenter.Set( fCenterX, fCenterY, fCenterZ, fRadius );
}

AE_FORCEINLINE AEBoundingSphere::AEBoundingSphere( const AEBoundingSphere &copy )
{
	m_vcCenter = copy.m_vcCenter;
}

AE_FORCEINLINE void AEBoundingSphere::SetFromCenterRadius( const AEVector4f &vcCenter, const float fRadius )
{
	/*m_vcCenter.fX = vcCenter.fX;
	m_vcCenter.fY = vcCenter.fY;
	m_vcCenter.fZ = vcCenter.fZ;
	m_vcCenter.fW = fRadius;*/

	m_vcCenter = vcCenter;
	m_vcCenter.SetW( fRadius );
}

AE_FORCEINLINE void AEBoundingSphere::SetFromValues( float fCenterX, float fCenterY, float fCenterZ, float fRadius )
{
	m_vcCenter.Set( fCenterX, fCenterY, fCenterZ, fRadius );
}

// TODO: Funzione non implementata
AE_FORCEINLINE void AEBoundingSphere::SetUnion( const AEBoundingSphere &bsSphere1, const AEBoundingSphere &bsSphere2 )
{
	AEMETHODNOTYETIMPLEMENTED();
}

// TODO: Funzione non implementata
AE_FORCEINLINE bool AEBoundingSphere::Intersects( const AEFrustum &frTestFrustum ) const
{
	AEMETHODNOTYETIMPLEMENTED();
	return false;
}

// TODO: Funzione non implementata
AE_FORCEINLINE bool AEBoundingSphere::Intersects( const AEPlane &plTestPlane ) const
{
	AEMETHODNOTYETIMPLEMENTED();
	return false;
}

// TODO: Funzione non implementata
AE_FORCEINLINE bool AEBoundingSphere::Intersects( const AERay &ryTestRay ) const
{
	AEMETHODNOTYETIMPLEMENTED();
	return false;
}

AE_FORCEINLINE bool AEBoundingSphere::IsValid( void ) const
{
	return ( m_vcCenter.IsOk<4>() && !IsEmpty() );
}

AE_FORCEINLINE bool AEBoundingSphere::IsEmpty( void ) const
{
	// TODO
	return false;//m_vcCenter.fW == 0.0;
}

// TODO: Funzione non implementata
AE_FORCEINLINE void AEBoundingSphere::IncludeAabb( const AEBoundingSphere &bbBox )
{
	AEMETHODNOTYETIMPLEMENTED();
}

// TODO: Funzione non implementata
AE_FORCEINLINE void AEBoundingSphere::IncludeSphere( const AEBoundingSphere &bsSphere )
{
	AEMETHODNOTYETIMPLEMENTED();
}

AE_FORCEINLINE void AEBoundingSphere::ExpandBy( float fValue )
{
	AEASSERT( IsValid() );
	// TODO
	//m_vcCenter.fW += fValue;
}

AE_FORCEINLINE const AEVector4f AEBoundingSphere::GetCenter( void ) const
{
	// TODO
	//return AEVector4f( m_vcCenter.fX, m_vcCenter.fY, m_vcCenter.fZ, 0.0f );
	return AEVector4f();
}

AE_FORCEINLINE float AEBoundingSphere::GetRadius( void ) const
{
	// TODO
	return m_vcCenter.GetComponent<3>();
}

#endif // _AEBOUNDINGSPHERE_INL_
